Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Using BUFFER-COPY and BUFFER-COMPARE
When copying fields from one record buffer to another,
BUFFER-COPYdoes it more efficiently thanASSIGN. Use theEXCEPToption when some fields are not to be copied, and theASSIGNoption when some fields are renamed during the copy operation. Even doing aBUFFER-COPYof a table with 100 fields is faster than anASSIGNstatement that copies a half dozen of those fields.In particular, the static
BUFFER-COPYstatement allows Progress to resolve the exact field list to copy and to identify the field mappings at compile time so that the operation can be made as fast as possible. Using the dynamicBUFFER-COPYmethod on a buffer handle requires Progress to evaluate the arguments during program execution, which of course is slower. As with all dynamic language, use theBUFFER-COPYmethod only when you truly don’t know the buffers or the fields to copy until run time.All this applies equally well to the
BUFFER-COMPAREstatement or method which compares two buffers and returns a list of differences.BUFFER-COMPAREis much faster than using a series of explicit comparison statements on individual fields.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |